<script type="text/javascript">
$('#indexPage').live('pagecreate',function(event){
	$('img.reflect').click(
			function(){
				$(this).animate({opacity:0.4},400, function(){
						$(this).animate({opacity:1},300);
					});
			}
		);
});
</script>
<div data-role="page"
	id="indexPage">
	<div data-role="header" data-theme="b">
		<h1>iLook - 新加坡</h1>
		<?php echo CHtml::link("关于",array("site/page","view"=>"about"),array("data-icon"=>"info"))?>
		<?php if(yii::app()->user->isGuest){
				echo CHtml::link("账户",array("site/login"),array("data-icon"=>"star"));}
			else {
				echo CHtml::link("注销",array("site/logout"),array("data-icon"=>"delete"));
			}?>
	</div>
	<!-- /header -->
	
	<div data-role="footer">
		<div data-role="navbar" data-theme="e" >
			<ul>
				<li><a rel='external' data-icon="home" data-theme="e" href="#indexPage">首页</a></li>
				<li><?php echo CHtml::link("新闻",array("news/list"),array("data-icon"=>"info","data-theme"=>"b"))?></li>
				<li><?php echo CHtml::link("论坛",array("bbs/list"),array("data-icon"=>"grid","data-theme"=>"b"))?></li>				
				<li><?php echo CHtml::link("用户",array("user/index"),array("data-icon"=>"star","data-theme"=>"b"))?></li>
				<li><a rel='external' data-icon="search" data-theme="b" href="#sitemap">地图</a></li>
			</ul>
	</div><!-- /navbar -->
	</div><!-- /footer -->

	<div data-role="content">
		<div class="content-primary">
			<ul data-role="listview" id="listview" data-theme="d">
				<?php foreach ($newsTopics as $newsTopic):?>
				<li><a style="padding-left: 6px;" rel='external' href="<?php echo Yii::app()->createUrl('news/view', array('id'=>$newsTopic->id)); ?>">
				<div class="tie-list-title">
				<?php echo "[".$newsTopic->category."]";
				if($newsTopic->flag == 'featured'){
					echo "<font color = red>[精品]</font>";
				}
				$words_count=Utils::gettitleWordCount();
				if(mb_strlen($newsTopic->title,"UTF-8")>$words_count){
					echo mb_substr($newsTopic->title, 0,$words_count-3,"UTF-8")."...";
				}else{
					echo mb_substr($newsTopic->title, 0,$words_count,"UTF-8");
				}
				?>
				</div>
				</a></li>
				<?php endforeach;?>
				<?php foreach ($bbsTopics as $bbsTopic):?>
				<li><a style="padding-left: 6px;" rel='external' href="<?php echo Yii::app()->createUrl('bbs/view', array('id'=>$bbsTopic->id)); ?>">
				<div class="tie-list-title">
				<?php echo "[".$bbsTopic->category."]";
				if($bbsTopic->flag == 'featured'){
					echo "<font color = red>[精品]</font>";
				}
				$words_count=Utils::gettitleWordCount();
				if(mb_strlen($bbsTopic->title,"UTF-8")>$words_count){
					echo mb_substr($bbsTopic->title, 0,$words_count-3,"UTF-8")."...";
				}else{
					echo mb_substr($bbsTopic->title, 0,$words_count,"UTF-8");
				}
				?>
				</div>
				</a></li>
				<?php endforeach;?>
				<?php foreach ($newsTopics2 as $newsTopic):?>
				<li><a style="padding-left: 6px;" rel='external' href="<?php echo Yii::app()->createUrl('news/view', array('id'=>$newsTopic->id)); ?>">
				<div class="tie-list-title">
				<?php echo "[".$newsTopic->category."]";
				if($newsTopic->flag == 'featured'){
					echo "<font color = red>[精品]</font>";
				}
				$words_count=Utils::gettitleWordCount();
				if(mb_strlen($newsTopic->title,"UTF-8")>$words_count){
					echo mb_substr($newsTopic->title, 0,$words_count-3,"UTF-8")."...";
				}else{
					echo mb_substr($newsTopic->title, 0,$words_count,"UTF-8");
				}
				?>
				</div>
				</a></li>
				<?php endforeach;?>
				<?php foreach ($bbsTopics2 as $bbsTopic):?>
				<li><a style="padding-left: 6px;" rel='external' href="<?php echo Yii::app()->createUrl('bbs/view', array('id'=>$bbsTopic->id)); ?>">
				<div class="tie-list-title">
				<?php echo "[".$bbsTopic->category."]";
				if($bbsTopic->flag == 'featured'){
					echo "<font color = red>[精品]</font>";
				}
				$words_count=Utils::gettitleWordCount();
				if(mb_strlen($bbsTopic->title,"UTF-8")>$words_count){
					echo mb_substr($bbsTopic->title, 0,$words_count-3,"UTF-8")."...";
				}else{
					echo mb_substr($bbsTopic->title, 0,$words_count,"UTF-8");
				}
				?>
				</div>
				</a></li>
				<?php endforeach;?>
				<li>
				<a href="http://www.iweb.sg">			
				<?php echo CHtml::image(Yii::app()->baseUrl."/images/icon/iweb.png","新闻快讯");?>
						<b>新加坡名片网</b> <br /> <span
					class='description'>新加坡城市黄页、电话本</span> </a>
				</li>
			</ul>
		</div>
		<div style='clear: both'></div>
	</div>
<!-- /content -->
<?php $this->renderPartial("//site/footer")?>
<!-- /footer -->

</div>
<!-- /page -->
<div data-role="page"
	id="sitemap">
	<div data-role="header" data-theme="b">
		<h1>iLook - 新加坡</h1>
		<?php echo CHtml::link("关于",array("site/page","view"=>"about"),array("data-icon"=>"info"))?>
		<?php if(yii::app()->user->isGuest){
				echo CHtml::link("账户",array("site/login"),array("data-icon"=>"star"));}
			else {
				echo CHtml::link("注销",array("site/logout"),array("data-icon"=>"delete"));
			}?>
	</div>
	<!-- /header -->
	<div data-role="footer">
		<div data-role="navbar" data-theme="e" >
			<ul>
				<li><a rel='external' data-icon="star" data-theme="b" href="#indexPage">首页</a></li>
				<li><?php echo CHtml::link("新闻",array("news/list"),array("data-icon"=>"info","data-theme"=>"b"))?></li>
				<li><?php echo CHtml::link("论坛",array("bbs/list"),array("data-icon"=>"grid","data-theme"=>"b"))?></li>		
				<li><?php echo CHtml::link("用户",array("user/index"),array("data-icon"=>"star","data-theme"=>"b"))?></li>
				<li><a rel='external' data-icon="search" data-theme="e" href="#servicePage">地图</a></li>
			</ul>
	</div><!-- /navbar -->
	</div><!-- /footer -->

	<div data-role="content">
		<div class="content-primary">
			<ul data-role="listview" id="listview" data-theme="d">
				<li>
				<a href="<?php echo Yii::app()->createUrl('news/list'); ?> ">			
				<?php echo CHtml::image(Yii::app()->baseUrl."/images/category/news.png","新闻快讯");?>
						<b>新闻iLook</b> <br /> <span
					class='description'>家事国事天下事，事事关心</span> </a>
				</li>
				<li>
				<a href="<?php echo Yii::app()->createUrl('bbs/list'); ?> ">			
				<?php echo CHtml::image(Yii::app()->baseUrl."/images/category/bbs.png","新闻快讯");?>
						<b>论坛iLook</b> <br /> <span
					class='description'>风声雨声读书声，声声入耳</span> </a>
				</li>
				<li>
				<a href="<?php echo Yii::app()->createUrl('user/index'); ?> " rel="external">			
				<?php echo CHtml::image(Yii::app()->baseUrl."/images/category/user.png","新闻快讯");?>
						<b>用户中心</b> <br /> <span
					class='description'>我的地盘我做主</span> </a>
				</li>
				<li>
				<a href="http://www.iweb.sg">			
				<?php echo CHtml::image(Yii::app()->baseUrl."/images/icon/iweb.png","新闻快讯");?>
						<b>新加坡名片网</b> <br /> <span
					class='description'>新加坡城市名片</span> </a>
				</li>
			</ul>
		</div>
		<div style='clear: both'></div>
	</div>
<!-- /content -->
<?php $this->renderPartial("//site/footer")?>
<!-- /footer -->

</div>
<!-- /page -->
